home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Source / WinTlb / WTYPES.IDL < prev   
Text File  |  1997-04-26  |  35KB  |  1,207 lines

  1. //+-------------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright (C) Microsoft Corporation, 1992 - 1996.
  5. //
  6. //  File: wtypes.idl
  7. //
  8. //  Contents: This interface definition contains typedefs for remotable
  9. //            data types.
  10. //
  11. //--------------------------------------------------------------------------
  12.  
  13. [ uuid(D3980A60-910C-1068-9341-00DD010F2F1C),
  14.   version(0.1), pointer_default(unique) ]
  15.  
  16. interface IWinTypes
  17. {
  18.  
  19. cpp_quote("//+-------------------------------------------------------------------------")
  20. cpp_quote("//")
  21. cpp_quote("//  Microsoft Windows")
  22. cpp_quote("//  Copyright (C) Microsoft Corporation, 1992 - 1996.")
  23. cpp_quote("//")
  24. cpp_quote("//--------------------------------------------------------------------------")
  25.  
  26. typedef struct RemHGLOBAL
  27. {
  28.         long fNullHGlobal;
  29.         unsigned long cbData;
  30.         [size_is(cbData)] byte data[];
  31. } RemHGLOBAL;
  32.  
  33. typedef struct RemHMETAFILEPICT
  34. {
  35.         long        mm;
  36.         long        xExt;
  37.         long        yExt;
  38.         unsigned long cbData;
  39.         [size_is(cbData)] byte data[];
  40. } RemHMETAFILEPICT;
  41.  
  42.  
  43. typedef struct RemHENHMETAFILE
  44. {
  45.         unsigned long cbData;
  46.         [size_is(cbData)] byte data[];
  47. } RemHENHMETAFILE;
  48.  
  49. typedef struct RemHBITMAP
  50. {
  51.         unsigned long cbData;
  52.         [size_is(cbData)] byte data[];
  53. } RemHBITMAP;
  54.  
  55. typedef struct RemHPALETTE
  56. {
  57.         unsigned long cbData;
  58.         [size_is(cbData)] byte data[];
  59. } RemHPALETTE;
  60.  
  61. typedef struct RemHBRUSH
  62. {
  63.         unsigned long cbData;
  64.         [size_is(cbData)] byte data[];
  65. } RemHBRUSH;
  66.  
  67.  
  68. cpp_quote("#if !defined(_WIN32) && !defined(_MPPC_)" )
  69. cpp_quote("// The following code is for Win16 only")
  70.  
  71. cpp_quote("#ifndef WINAPI          // If not included with 3.1 headers... ")
  72.  
  73. cpp_quote("#define FAR             _far")
  74. cpp_quote("#define PASCAL          _pascal")
  75. cpp_quote("#define CDECL           _cdecl")
  76.  
  77. cpp_quote("#define VOID            void")
  78. cpp_quote("#define WINAPI      FAR PASCAL")
  79. cpp_quote("#define CALLBACK    FAR PASCAL")
  80.  
  81.  
  82.  
  83. cpp_quote("#ifndef FALSE")
  84. cpp_quote("#define FALSE 0")
  85. cpp_quote("#define TRUE 1")
  86. cpp_quote("#endif // !FALSE")
  87.  
  88. cpp_quote("#ifndef _BYTE_DEFINED")
  89. cpp_quote("#define _BYTE_DEFINED")
  90. typedef unsigned char BYTE;
  91. cpp_quote("#endif // !_BYTE_DEFINED")
  92.  
  93. cpp_quote("#ifndef _WORD_DEFINED")
  94. cpp_quote("#define _WORD_DEFINED")
  95. typedef short WORD;
  96. cpp_quote("#endif // !_WORD_DEFINED")
  97.  
  98. typedef int UINT;
  99. typedef int  INT;
  100. // typedef long BOOL;
  101. typedef enum BOOL {
  102.     APITRUE = 1,
  103.     APIFALSE = 0
  104. } BOOL;
  105.  
  106. cpp_quote("#ifndef _LONG_DEFINED")
  107. cpp_quote("#define _LONG_DEFINED")
  108. typedef long LONG;
  109. cpp_quote("#endif // !_LONG_DEFINED")
  110.  
  111. cpp_quote("#ifndef _WPARAM_DEFINED")
  112. cpp_quote("#define _WPARAM_DEFINED")
  113. typedef UINT WPARAM;
  114. cpp_quote("#endif // _WPARAM_DEFINED")
  115.  
  116. cpp_quote("#ifndef _DWORD_DEFINED")
  117. cpp_quote("#define _DWORD_DEFINED")
  118. typedef long DWORD;
  119. cpp_quote("#endif // !_DWORD_DEFINED")
  120.  
  121. cpp_quote("#ifndef _LPARAM_DEFINED")
  122. cpp_quote("#define _LPARAM_DEFINED")
  123. typedef void * LPARAM;//BUGBUG: this should be a discriminated union.
  124. cpp_quote("#endif // !_LPARAM_DEFINED")
  125.  
  126. cpp_quote("#ifndef _LRESULT_DEFINED")
  127. cpp_quote("#define _LRESULT_DEFINED")
  128. typedef LONG LRESULT;
  129. cpp_quote("#endif // !_LRESULT_DEFINED")
  130.  
  131. typedef long HANDLE;
  132. #define DECLARE_WIREM_HANDLE(name)  \
  133.                              typedef [wire_marshal(wire ## name)] void * name
  134. #define DECLARE_HANDLE(name) typedef void * name
  135.  
  136. DECLARE_HANDLE(HMODULE);
  137. DECLARE_HANDLE(HINSTANCE);
  138. DECLARE_HANDLE(HICON);
  139. DECLARE_HANDLE(HFONT);
  140.  
  141. DECLARE_HANDLE(HDC);
  142. DECLARE_HANDLE(HRGN);
  143. DECLARE_HANDLE(HTASK);
  144. DECLARE_HANDLE(HKEY);
  145.  
  146. DECLARE_HANDLE(HDESK);
  147.  
  148. DECLARE_HANDLE(HMF);
  149. DECLARE_HANDLE(HEMF);
  150.  
  151. DECLARE_HANDLE(HPEN);
  152. DECLARE_HANDLE(HRSRC);
  153. DECLARE_HANDLE(HSTR);
  154. DECLARE_HANDLE(HWINSTA);
  155. DECLARE_HANDLE(HKL);
  156. DECLARE_HANDLE(HGDIOBJ);
  157.  
  158. typedef HANDLE HDWP;
  159.  
  160. cpp_quote("#ifndef _HFILE_DEFINED")
  161. cpp_quote("#define _HFILE_DEFINED")
  162. typedef INT HFILE;      /* Polymorphic with C runtime file handle type */
  163. cpp_quote("#endif // !_HFILE_DEFINED")
  164.  
  165.  
  166. cpp_quote("#ifndef _HCURSOR_DEFINED")
  167. cpp_quote("#define _HCURSOR_DEFINED")
  168. typedef HICON HCURSOR;      /* HICONs & HCURSORs are polymorphic */
  169. cpp_quote("#endif // !_HCURSOR_DEFINED")
  170.  
  171.  
  172.  
  173. cpp_quote("#ifndef _LPWORD_DEFINED")
  174. cpp_quote("#define _LPWORD_DEFINED")
  175. typedef WORD *LPWORD;
  176. cpp_quote("#endif // !_LPWORD_DEFINED")
  177.  
  178.  
  179. cpp_quote("#ifndef _LPDWORD_DEFINED")
  180. cpp_quote("#define _LPDWORD_DEFINED")
  181. typedef DWORD *LPDWORD;
  182. cpp_quote("#endif // !_LPDWORD_DEFINED")
  183.  
  184.  
  185. typedef [string] char *LPSTR;
  186.  
  187. typedef [string] const char *LPCSTR;
  188.  
  189.  
  190. cpp_quote("#ifndef _WCHAR_DEFINED")
  191. cpp_quote("#define _WCHAR_DEFINED")
  192. typedef wchar_t WCHAR;
  193. typedef WCHAR   TCHAR;
  194. cpp_quote("#endif // !_WCHAR_DEFINED")
  195.  
  196. typedef [string] WCHAR *LPWSTR;
  197.  
  198. typedef [string] TCHAR *LPTSTR;
  199.  
  200. typedef [string] const WCHAR *LPCWSTR;
  201. typedef [string] const TCHAR *LPCTSTR;
  202.  
  203.  
  204. typedef struct PALETTEENTRY {
  205.     BYTE        peRed;
  206.     BYTE        peGreen;
  207.     BYTE        peBlue;
  208.     BYTE        peFlags;
  209. } PALETTEENTRY, *PPALETTEENTRY, *LPPALETTEENTRY;
  210.  
  211. // Logical Palette
  212. cpp_quote("#if 0")
  213.  
  214.     typedef struct LOGPALETTE {
  215.         WORD        palVersion;
  216.         WORD        palNumEntries;
  217.         [size_is(palNumEntries)] PALETTEENTRY        palPalEntry[];
  218.     } LOGPALETTE, *PLOGPALETTE, *LPLOGPALETTE;
  219.  
  220. cpp_quote("#else")
  221. cpp_quote("typedef struct LOGPALETTE {")
  222. cpp_quote("    WORD        palVersion;")
  223. cpp_quote("    WORD        palNumEntries;")
  224. cpp_quote("    PALETTEENTRY        palPalEntry[1];")
  225. cpp_quote("} LOGPALETTE, *PLOGPALETTE, *LPLOGPALETTE;")
  226. cpp_quote("#endif")
  227.  
  228. cpp_quote("#ifndef _COLORREF_DEFINED")
  229. cpp_quote("#define _COLORREF_DEFINED")
  230. typedef DWORD COLORREF;
  231. cpp_quote("#endif // !_COLORREF_DEFINED")
  232.  
  233. cpp_quote("#ifndef _LPCOLORREF_DEFINED")
  234. cpp_quote("#define _LPCOLORREF_DEFINED")
  235. typedef DWORD *LPCOLORREF;
  236. cpp_quote("#endif // !_LPCOLORREF_DEFINED")
  237.  
  238.  
  239. typedef HANDLE *LPHANDLE;
  240.  
  241. //typedefs for remotable types from wingdi.h
  242.  
  243. typedef struct RECTL
  244. {
  245.     LONG    left;
  246.     LONG    top;
  247.     LONG    right;
  248.     LONG    bottom;
  249. } RECTL, *PRECTL, *LPRECTL;
  250.  
  251.  
  252. typedef struct POINT
  253. {
  254.     LONG  x;
  255.     LONG  y;
  256. } POINT, *PPOINT, *LPPOINT;
  257.  
  258. typedef struct POINTL
  259. {
  260.     LONG  x;
  261.     LONG  y;
  262. } POINTL, *PPOINTL;
  263.  
  264.  
  265.  
  266. cpp_quote("#ifndef WIN16")
  267. typedef struct SIZE
  268. {
  269.     LONG        cx;
  270.     LONG        cy;
  271. } SIZE, *PSIZE, *LPSIZE;
  272. cpp_quote("#else // WIN16")
  273. cpp_quote("typedef struct SIZE")
  274. cpp_quote("{")
  275. cpp_quote("    INT cx;")
  276. cpp_quote("    INT cy;")
  277. cpp_quote("} SIZE, *PSIZE, *LPSIZE;")
  278. cpp_quote("#endif // WIN16")
  279.  
  280.  
  281. typedef struct SIZEL
  282. {
  283.     LONG cx;
  284.     LONG cy;
  285. } SIZEL, *PSIZEL, *LPSIZEL;
  286.  
  287.  
  288. cpp_quote("#endif  //WINAPI")
  289. cpp_quote("#endif  //!WIN32 && !MPPC")
  290.  
  291. cpp_quote("#if defined(_WIN32) && !defined(OLE2ANSI)")
  292.  
  293. typedef WCHAR                   OLECHAR;
  294. typedef [string] OLECHAR       *LPOLESTR;
  295. typedef [string] const OLECHAR *LPCOLESTR;
  296. cpp_quote("#define OLESTR(str) L##str")
  297.  
  298. cpp_quote("")
  299. cpp_quote("#else")
  300. cpp_quote("")
  301.  
  302. cpp_quote("typedef char      OLECHAR;")
  303. cpp_quote("typedef LPSTR     LPOLESTR;")
  304. cpp_quote("typedef LPCSTR    LPCOLESTR;")
  305. cpp_quote("#define OLESTR(str) str")
  306.  
  307. cpp_quote("#endif")
  308.  
  309.  
  310.  
  311.  
  312.  
  313. // This block contains types that are normally defined by the nt sdk in WINDEF.H
  314. // but we need them here for definitions that follow in this file.  If WINDEF.H
  315. // hasn't been included then we need to define them now so that WTYPES.H
  316. // will compile.
  317. cpp_quote("#ifndef _WINDEF_")
  318. typedef const RECTL *LPCRECTL;
  319.  
  320. typedef void * PVOID, *LPVOID;
  321. typedef struct RECT
  322. {
  323.     LONG    left;
  324.     LONG    top;
  325.     LONG    right;
  326.     LONG    bottom;
  327. } RECT, *PRECT, *LPRECT;
  328. typedef const RECT *LPCRECT;
  329.  
  330. cpp_quote("#endif  //_WINDEF_")
  331.  
  332.  
  333.  
  334.  
  335. typedef unsigned char  UCHAR;
  336. typedef short SHORT;
  337. typedef unsigned short USHORT;
  338. typedef DWORD ULONG;
  339.  
  340. // just for local wtypes
  341. cpp_quote("#if 0")
  342. //
  343. // __int64 is only supported by 2.0 and later midl.
  344. // __midl is set by the 2.0 midl and not by 1.0 midl.
  345. //
  346.  
  347. #if (defined(__midl))
  348. typedef __int64 LONGLONG;
  349. typedef unsigned __int64 ULONGLONG;
  350. #else
  351. typedef double LONGLONG;
  352. typedef double ULONGLONG;
  353. #endif
  354.  
  355. typedef LONGLONG *PLONGLONG;
  356. typedef ULONGLONG *PULONGLONG;
  357.  
  358. typedef struct LARGE_INTEGER {
  359.     LONGLONG QuadPart;
  360. } LARGE_INTEGER;
  361.  
  362. typedef LARGE_INTEGER *PLARGE_INTEGER;
  363.  
  364. typedef struct ULARGE_INTEGER {
  365.     ULONGLONG QuadPart;
  366. } ULARGE_INTEGER;
  367.  
  368. // just for local wtypes
  369. cpp_quote("#endif // 0")
  370.  
  371.  
  372. cpp_quote("#ifndef _WINBASE_")
  373.  
  374. cpp_quote("#ifndef _FILETIME_")
  375. cpp_quote("#define _FILETIME_")
  376. typedef struct FILETIME
  377. {
  378.     DWORD dwLowDateTime;
  379.     DWORD dwHighDateTime;
  380. } FILETIME;
  381. typedef void * PFILETIME;
  382. typedef void * LPFILETIME;
  383. cpp_quote("#endif // !_FILETIME")
  384.  
  385. cpp_quote("#ifndef _SYSTEMTIME_")
  386. cpp_quote("#define _SYSTEMTIME_")
  387. typedef struct SYSTEMTIME {
  388.     WORD wYear;
  389.     WORD wMonth;
  390.     WORD wDayOfWeek;
  391.     WORD wDay;
  392.     WORD wHour;
  393.     WORD wMinute;
  394.     WORD wSecond;
  395.     WORD wMilliseconds;
  396. } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
  397.  
  398. cpp_quote("#endif // !_SYSTEMTIME")
  399.  
  400. cpp_quote("#ifndef _SECURITY_ATTRIBUTES_")
  401. cpp_quote("#define _SECURITY_ATTRIBUTES_")
  402. typedef struct SECURITY_ATTRIBUTES {
  403.     DWORD nLength;
  404.     //[size_is(nLength)] LPVOID lpSecurityDescriptor;
  405.     long lpSecurityDescriptor;
  406.     BOOL bInheritHandle;
  407. } SECURITY_ATTRIBUTES;
  408. typedef LPVOID PSECURITY_ATTRIBUTES;
  409. typedef LPVOID LPSECURITY_ATTRIBUTES;
  410. cpp_quote("#endif // !_SECURITY_ATTRIBUTES_")
  411.  
  412. cpp_quote("#ifndef SECURITY_DESCRIPTOR_REVISION")
  413.  
  414. typedef USHORT SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
  415.  
  416. typedef PVOID PSID;     // winnt
  417.  
  418. typedef struct ACL {
  419.     UCHAR AclRevision;
  420.     UCHAR Sbz1;
  421.     USHORT AclSize;
  422.     USHORT AceCount;
  423.     USHORT Sbz2;
  424. } ACL;
  425. typedef ACL *PACL;
  426.  
  427. typedef struct SECURITY_DESCRIPTOR {
  428.     UCHAR Revision;
  429.     UCHAR Sbz1;
  430.     SECURITY_DESCRIPTOR_CONTROL Control;
  431.     PSID Owner;
  432.     PSID Group;
  433.     PACL Sacl;
  434.     PACL Dacl;
  435. } SECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR;
  436.  
  437. cpp_quote("#endif // !SECURITY_DESCRIPTOR_REVISION")
  438.  
  439. cpp_quote("#endif //_WINBASE_")
  440.  
  441.  
  442. //
  443. // SCODE, HRESULT
  444. //
  445. //
  446. //  Status values are 32 bit values layed out as follows:
  447. //
  448. //   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  449. //   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  450. //  +-+-----------------------------+-------------------------------+
  451. //  |S|       Facility              |               Code            |
  452. //  +-+-----------------------------+-------------------------------+
  453. //
  454. //  where
  455. //
  456. //      S - is the severity code
  457. //
  458. //          0 - Success
  459. //          1 - Error
  460. //
  461. //
  462. //      Facility - is the facility code
  463. //
  464. //      Code - is the facility's status code
  465. //
  466. // SCODE and HRESULT are mktyplib base types.
  467. //
  468. typedef LONG SCODE;
  469. cpp_quote("#ifndef _HRESULT_DEFINED")
  470. cpp_quote("#define _HRESULT_DEFINED")
  471. #if defined(_STRICT_HRESULT)
  472. typedef struct HRESULT_STRUCT {
  473.         DWORD Data1;
  474. } HRESULT_STRUCT, *PHRESULT_STRUCT;
  475. typedef PHRESULT_STRUCT HRESULT;
  476. #else // defined(_STRICT_HRESULT)
  477. typedef LONG HRESULT;
  478. #endif // defined(_STRICT_HRESULT)
  479. cpp_quote("#endif // !_HRESULT_DEFINED")
  480.  
  481. typedef SCODE *PSCODE;
  482.  
  483.  
  484. cpp_quote("#ifndef GUID_DEFINED")
  485. cpp_quote("#define GUID_DEFINED")
  486. typedef struct GUID {
  487.     DWORD Data1;
  488.     WORD  Data2;
  489.     WORD  Data3;
  490.     BYTE  Data4[8];
  491. } GUID;
  492. cpp_quote("#endif // !GUID_DEFINED")
  493.  
  494. cpp_quote("#if !defined( __LPGUID_DEFINED__ )")
  495. cpp_quote("#define __LPGUID_DEFINED__")
  496. typedef GUID *LPGUID;
  497. cpp_quote("#endif // !__LPGUID_DEFINED__")
  498.  
  499. cpp_quote("#ifndef __OBJECTID_DEFINED")
  500. cpp_quote("#define __OBJECTID_DEFINED")
  501. cpp_quote("#define _OBJECTID_DEFINED")
  502. typedef struct OBJECTID      // NOTE!! Order of structure members is important for OFS
  503. {                            // enumeration.
  504.    GUID Lineage;             // Unique for objects copied from same original and copies of.
  505.    unsigned long Uniquifier; // Random, to provide uniqueness within small set with same
  506. } OBJECTID;                  // lineage id.
  507. cpp_quote("#endif // !_OBJECTID_DEFINED")
  508.  
  509.  
  510.  
  511.  
  512. cpp_quote("#if !defined( __IID_DEFINED__ )")
  513. cpp_quote("#define __IID_DEFINED__")
  514.  
  515. // Interface ID are just a kind of GUID
  516. typedef GUID IID;
  517. typedef IID *LPIID;
  518. cpp_quote("#define IID_NULL            GUID_NULL")
  519. cpp_quote("#define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)")
  520.  
  521. // Class ID are just a kind of GUID
  522. typedef GUID CLSID;
  523. typedef              CLSID *LPCLSID;
  524. cpp_quote("#define CLSID_NULL          GUID_NULL")
  525. cpp_quote("#define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)")
  526.  
  527. //The following typedefs are used internally by MIDL.
  528. cpp_quote("#if 0")
  529. #if defined(__midl)
  530.     /* MIDL 2.0 definitions */
  531.     typedef GUID *REFGUID;
  532.     typedef IID *REFIID;
  533.     typedef CLSID *REFCLSID;
  534. #else
  535.     /* MIDL 1.1 definitions */
  536.     typedef GUID REFGUID;
  537.     typedef IID REFIID;
  538.     typedef CLSID REFCLSID;
  539. #endif
  540. cpp_quote("#endif // 0")
  541.  
  542. cpp_quote("#if defined(__cplusplus)")
  543.  
  544. cpp_quote("#ifndef _REFGUID_DEFINED")
  545. cpp_quote("#define _REFGUID_DEFINED")
  546. cpp_quote("#define REFGUID             const GUID &")
  547. cpp_quote("#endif // !_REFGUID_DEFINED")
  548.  
  549. cpp_quote("#ifndef _REFIID_DEFINED")
  550. cpp_quote("#define _REFIID_DEFINED")
  551. cpp_quote("#define REFIID              const IID &")
  552. cpp_quote("#endif // !_REFIID_DEFINED")
  553.  
  554. cpp_quote("#ifndef _REFCLSID_DEFINED")
  555. cpp_quote("#define _REFCLSID_DEFINED")
  556. cpp_quote("#define REFCLSID            const CLSID &")
  557. cpp_quote("#endif // !_REFCLSID_DEFINED")
  558.  
  559.  
  560. cpp_quote("#else // !__cplusplus")
  561.  
  562. cpp_quote("#ifndef _REFGUID_DEFINED")
  563. cpp_quote("#define _REFGUID_DEFINED")
  564. cpp_quote("#define REFGUID             const GUID * const")
  565. cpp_quote("#endif // !_REFGUID_DEFINED")
  566.  
  567. cpp_quote("#ifndef _REFIID_DEFINED")
  568. cpp_quote("#define _REFIID_DEFINED")
  569. cpp_quote("#define REFIID              const IID * const")
  570. cpp_quote("#endif // !_REFIID_DEFINED")
  571.  
  572.  
  573. cpp_quote("#ifndef _REFCLSID_DEFINED")
  574. cpp_quote("#define _REFCLSID_DEFINED")
  575. cpp_quote("#define REFCLSID            const CLSID * const")
  576. cpp_quote("#endif // !_REFCLSID_DEFINED")
  577.  
  578. cpp_quote("#endif // !__cplusplus")
  579.  
  580. cpp_quote("#endif // !__IID_DEFINED__")
  581.  
  582.     /************************* Misc types ***********************************/
  583.  
  584.     // Common typdefs used in API paramaters, gleamed from compobj.h
  585.  
  586.     // memory context values; passed to CoGetMalloc
  587.     typedef enum tagMEMCTX
  588.     {
  589.         MEMCTX_TASK = 1,            // task (private) memory
  590.         MEMCTX_SHARED = 2,          // shared memory (between processes)
  591.         MEMCTX_MACSYSTEM = 3,       // on the mac, the system heap
  592.         // these are mostly for internal use...
  593.         MEMCTX_UNKNOWN = -1,        // unknown context (when asked about it)
  594.         MEMCTX_SAME = -2,           // same context (as some other pointer)
  595.     } MEMCTX;
  596.  
  597.  
  598. // For IRunningObjectTable::Register
  599. cpp_quote("#ifndef _ROTFLAGS_DEFINED")
  600. cpp_quote("#define _ROTFLAGS_DEFINED")
  601. cpp_quote("#define ROTFLAGS_REGISTRATIONKEEPSALIVE 1")
  602. cpp_quote("#endif // !_ROTFLAGS_DEFINED")
  603.  
  604. // Maximum size of comparison buffer for IROTData::GetComparisonData
  605. cpp_quote("#ifndef _ROT_COMPARE_MAX_DEFINED")
  606. cpp_quote("#define _ROT_COMPARE_MAX_DEFINED")
  607. cpp_quote("#define ROT_COMPARE_MAX 2048")
  608. cpp_quote("#endif // !_ROT_COMPARE_MAX_DEFINED")
  609.  
  610.  
  611.     // class context: used to determine what scope and kind of class object to use
  612.     // NOTE: this is a bitwise enum
  613.     typedef enum tagCLSCTX
  614.     {
  615.         CLSCTX_INPROC_SERVER = 0x01,   // server dll (runs in same process as caller)
  616.         CLSCTX_INPROC_HANDLER = 0x02,  // handler dll (runs in same process as caller)
  617.         CLSCTX_LOCAL_SERVER = 0x04,    // server exe (runs on same machine; diff proc)
  618.         CLSCTX_INPROC_SERVER16 = 0x08, // 16-bit server dll (runs in same process as caller)
  619.         CLSCTX_REMOTE_SERVER = 0x10,    // remote server exe (runs on different machine)
  620.         CLSCTX_INPROC_HANDLER16 = 0x20, // 16-bit handler dll (runs in same process as caller)
  621.         CLSCTX_INPROC_SERVERX86 = 0x40, // Wx86 server dll (runs in same process as caller)
  622.         CLSCTX_INPROC_HANDLERX86 = 0x80, // Wx86 handler dll (runs in same process as caller)
  623.     } CLSCTX;
  624.  
  625.  
  626.     // marshaling flags; passed to CoMarshalInterface
  627.     typedef enum tagMSHLFLAGS
  628.     {
  629.         MSHLFLAGS_NORMAL = 0,       // normal marshaling via proxy/stub
  630.         MSHLFLAGS_TABLESTRONG = 1,  // keep object alive; must explicitly release
  631.     MSHLFLAGS_TABLEWEAK = 2,    // doesn't hold object alive; still must release
  632.     MSHLFLAGS_NOPING = 4        // remote clients dont 'ping' to keep objects alive
  633.     } MSHLFLAGS;
  634.  
  635.     // marshal context: determines the destination context of the marshal operation
  636.     typedef enum tagMSHCTX
  637.     {
  638.         MSHCTX_LOCAL = 0,           // unmarshal context is local (eg.shared memory)
  639.         MSHCTX_NOSHAREDMEM = 1,     // unmarshal context has no shared memory access
  640.         MSHCTX_DIFFERENTMACHINE = 2,// unmarshal context is on a different machine
  641.         MSHCTX_INPROC = 3,          // unmarshal context is on different thread
  642.     } MSHCTX;
  643.  
  644.  
  645.     //
  646.     // Common typedefs for paramaters used in data view API's, gleamed
  647.     // from dvobj.h
  648.     //
  649.  
  650.     // Data/View aspect; specifies the desired aspect of the object when
  651.     // drawing or getting data.
  652.     typedef enum tagDVASPECT
  653.     {
  654.         DVASPECT_CONTENT = 1,
  655.         DVASPECT_THUMBNAIL = 2,
  656.         DVASPECT_ICON = 4,
  657.         DVASPECT_DOCPRINT = 8
  658.     } DVASPECT;
  659.  
  660.     /****** Storage types *************************************************/
  661.  
  662.  
  663.     /* Storage commit types */
  664.     typedef enum tagSTGC
  665.     {
  666.         STGC_DEFAULT        = 0,
  667.         STGC_OVERWRITE      = 1,
  668.         STGC_ONLYIFCURRENT  = 2,
  669.         STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4
  670.     } STGC;
  671.  
  672.  
  673.     typedef enum tagSTGMOVE
  674.     {
  675.         STGMOVE_MOVE    = 0,
  676.         STGMOVE_COPY    = 1,
  677.         STGMOVE_SHALLOWCOPY = 2
  678.     } STGMOVE;
  679.  
  680.     typedef enum tagSTATFLAG
  681.     {
  682.         STATFLAG_DEFAULT = 0,
  683.         STATFLAG_NONAME = 1,
  684.         STATFLAG_NOOPEN = 2
  685.     } STATFLAG;
  686.  
  687.  
  688. typedef [context_handle] void *HCONTEXT;
  689.  
  690. /****** Critical Section Wrappers ***********************************/
  691.  
  692.  
  693. /* if not already picked up from olenls.h */
  694. cpp_quote("#ifndef _LCID_DEFINED")
  695. cpp_quote("#define _LCID_DEFINED")
  696. typedef DWORD LCID;
  697. cpp_quote("#endif // !_LCID_DEFINED")
  698.  
  699. // #######################################################################
  700. //
  701. //  User marshal support for Windows data types.
  702.  
  703. //
  704. //  Frequently used helpers: sized blobs
  705. //
  706. //      Never put [user_marshal] or [wire_marshal] on the helpers directly.
  707. //
  708.  
  709. // Simple blobs.
  710.  
  711. typedef struct BYTE_BLOB {
  712.                         unsigned long   clSize;
  713.     [size_is(clSize)]   byte            abData[];
  714.     } BYTE_BLOB;
  715.  
  716. typedef [unique] BYTE_BLOB * UP_BYTE_BLOB;
  717.  
  718. typedef struct WORD_BLOB {
  719.                         unsigned long   clSize;
  720.     [size_is(clSize)]   unsigned short  asData[];
  721.     } WORD_BLOB;
  722.  
  723. typedef [unique] WORD_BLOB * UP_WORD_BLOB;
  724.  
  725. typedef struct DWORD_BLOB {
  726.                         unsigned long   clSize;
  727.     [size_is(clSize)]   unsigned long   alData[];
  728.     } DWORD_BLOB;
  729.  
  730. typedef [unique] DWORD_BLOB * UP_DWORD_BLOB;
  731.  
  732. // Flagged blobs.
  733.  
  734. typedef struct FLAGGED_BYTE_BLOB {
  735.                         unsigned long   fFlags;
  736.                         unsigned long   clSize;
  737.     [size_is(clSize)]   byte            abData[];
  738.     } FLAGGED_BYTE_BLOB;
  739.  
  740. typedef [unique] FLAGGED_BYTE_BLOB * UP_FLAGGED_BYTE_BLOB;
  741.  
  742. typedef struct FLAGGED_WORD_BLOB {
  743.                         unsigned long   fFlags;
  744.                         unsigned long   clSize;
  745.     [size_is(clSize)]   unsigned short  asData[];
  746.     } FLAGGED_WORD_BLOB;
  747.  
  748. typedef [unique] FLAGGED_WORD_BLOB * UP_FLAGGED_WORD_BLOB;
  749.  
  750. // Frequently used helpers with sized pointers.
  751.  
  752. typedef struct BYTE_SIZEDARR {
  753.                         unsigned long   clSize;
  754.     [size_is(clSize)]   byte     *      pData ;
  755.     } BYTE_SIZEDARR;
  756.  
  757. typedef struct SHORT_SIZEDARR {
  758.                         unsigned long   clSize;
  759.     [size_is(clSize)]   unsigned short* pData ;
  760.     } WORD_SIZEDARR;
  761.  
  762. typedef struct LONG_SIZEDARR {
  763.                         unsigned long   clSize;
  764.     [size_is(clSize)]   unsigned long * pData ;
  765.     } DWORD_SIZEDARR;
  766.  
  767. typedef struct HYPER_SIZEDARR {
  768.                         unsigned long   clSize;
  769.     [size_is(clSize)]   hyper         * pData ;
  770.     } HYPER_SIZEDARR;
  771.  
  772.  
  773. // #########################################################################
  774. //
  775. //   Constants for the call context
  776. //
  777.  
  778. const unsigned long WDT_INPROC_CALL = 0x48746457;
  779. const unsigned long WDT_REMOTE_CALL = 0x52746457;
  780.  
  781.  
  782. // #########################################################################
  783. //
  784. //  CLIPFORMAT
  785. //
  786.  
  787. typedef union _userCLIPFORMAT switch(long fContext) u
  788. {
  789.     case WDT_INPROC_CALL:         DWORD     dwValue;
  790.     case WDT_REMOTE_CALL:   [string] wchar_t * pwszName;
  791. } userCLIPFORMAT;
  792.  
  793. typedef [unique] userCLIPFORMAT *  wireCLIPFORMAT;
  794.  
  795. typedef [wire_marshal(wireCLIPFORMAT)] WORD  CLIPFORMAT;
  796.  
  797.  
  798. // #########################################################################
  799. //
  800. //  Good for most of the gdi handles.
  801.  
  802. typedef union _GDI_NONREMOTE switch( long fContext ) u
  803. {
  804.     case WDT_INPROC_CALL:   long        hInproc;
  805.     case WDT_REMOTE_CALL:   DWORD_BLOB *hRemote;
  806.     default:                long        hGlobal;
  807. } GDI_NONREMOTE;
  808.  
  809.  
  810. // #########################################################################
  811. //
  812. //  HGLOBAL
  813. //
  814. // A global may be Null or may be non-NULL with 0 length.
  815.  
  816. typedef union _userHGLOBAL switch( long fContext ) u
  817. {
  818.     case WDT_INPROC_CALL:   long            hInproc;
  819.     case WDT_REMOTE_CALL:   FLAGGED_BYTE_BLOB *     hRemote;
  820.     default:                long            hGlobal;
  821. } userHGLOBAL;
  822.  
  823. typedef [unique] userHGLOBAL       * wireHGLOBAL;
  824.  
  825.  
  826. // #########################################################################
  827. //
  828. //  HMETAFILE
  829. //
  830.  
  831. typedef union _userHMETAFILE switch( long fContext ) u
  832. {
  833.     case WDT_INPROC_CALL:   long            hInproc;
  834.     case WDT_REMOTE_CALL:   BYTE_BLOB *     hRemote;
  835.     default:                long            hGlobal;
  836. } userHMETAFILE;
  837.  
  838.  
  839. // #########################################################################
  840. //
  841. //  HMETAFILEPICT
  842. //
  843. typedef struct remoteMETAFILEPICT
  844. {
  845.     long            mm;
  846.     long            xExt;
  847.     long            yExt;
  848.     userHMETAFILE * hMF;
  849. } remoteMETAFILEPICT;
  850.  
  851. typedef union _userHMETAFILEPICT switch( long fContext ) u
  852. {
  853.     case WDT_INPROC_CALL:   long                hInproc;
  854.     case WDT_REMOTE_CALL:   remoteMETAFILEPICT* hRemote;
  855.     default:                long                hGlobal;
  856. } userHMETAFILEPICT;
  857.  
  858.  
  859. // #########################################################################
  860. //
  861. //  HENHMETAFILE
  862. //
  863.  
  864. typedef union _userHENHMETAFILE switch( long fContext ) u
  865. {
  866.     case WDT_INPROC_CALL:   long            hInproc;
  867.     case WDT_REMOTE_CALL:   BYTE_BLOB *     hRemote;
  868.     default:                long            hGlobal;
  869. } userHENHMETAFILE;
  870.  
  871.  
  872. // #########################################################################
  873. //
  874. //  HBITMAP
  875. //
  876.  
  877. // RemHBITMAP was just a byte blob, but the whole bitmap structure was copied
  878. // at the beginning of the buffer.
  879.  
  880. // So, we take BITMAP fields from wingdi.x
  881.  
  882. typedef struct _userBITMAP
  883. {
  884.     LONG            bmType;
  885.     LONG            bmWidth;
  886.     LONG            bmHeight;
  887.     LONG            bmWidthBytes;
  888.     WORD            bmPlanes;
  889.     WORD            bmBitsPixel;
  890.     ULONG                       cbSize;
  891.     [size_is(cbSize)]   byte    pBuffer[];
  892. } userBITMAP;
  893.  
  894.  
  895. typedef union _userHBITMAP switch( long fContext ) u
  896. {
  897.     case WDT_INPROC_CALL:   long            hInproc;
  898.     case WDT_REMOTE_CALL:   userBITMAP *    hRemote;
  899.     default:                long            hGlobal;
  900. } userHBITMAP;
  901.  
  902.  
  903. // #########################################################################
  904. //
  905. //  HPALETTE
  906. //
  907.  
  908. // PALETTEENTRY is in wingdi.x, it is a struct with 4 bytes.
  909. // LOGPALETTE   is in wingdi.x, it is a conf struct with paletteentries and
  910. //                                    a version field
  911.  
  912. typedef struct tagrpcLOGPALETTE {
  913.     WORD                        palVersion;
  914.     WORD                        palNumEntries;
  915.     [size_is( palNumEntries )]  PALETTEENTRY        palPalEntry[];
  916. } rpcLOGPALETTE;
  917.  
  918. typedef union _userHPALETTE switch( long fContext ) u
  919. {
  920.     case WDT_INPROC_CALL:   long            hInproc;
  921.     case WDT_REMOTE_CALL:   rpcLOGPALETTE * hRemote;
  922.     default:                long            hGlobal;
  923. } userHPALETTE;
  924.  
  925.  
  926. // #########################################################################
  927. //
  928. //  Handles passed locally as longs.
  929. //
  930.  
  931. typedef union _RemotableHandle switch( long fContext ) u
  932. {
  933.     case WDT_INPROC_CALL:   long   hInproc;
  934.     case WDT_REMOTE_CALL:   long   hRemote;
  935.     default:                long   hGlobal;
  936. } RemotableHandle;
  937.  
  938. typedef [unique] RemotableHandle * wireHWND;
  939. typedef [unique] RemotableHandle * wireHMENU;
  940. typedef [unique] RemotableHandle * wireHACCEL;
  941. typedef [unique] RemotableHandle * wireHBRUSH;
  942.  
  943.  
  944. cpp_quote("#if 0")
  945. DECLARE_WIREM_HANDLE( HWND );
  946. DECLARE_WIREM_HANDLE( HMENU );
  947. DECLARE_WIREM_HANDLE( HACCEL );
  948. DECLARE_WIREM_HANDLE( HBRUSH );
  949. cpp_quote("#endif //0")
  950.  
  951. cpp_quote("#ifndef _WIN32           // The following code is for Win16 only")
  952. cpp_quote("#ifndef WINAPI          // If not included with 3.1 headers... ")
  953.  
  954. // Message structure
  955.  
  956. typedef struct tagMSG {
  957.     HWND        hwnd;
  958.     UINT        message;
  959.     WPARAM      wParam;
  960.     LPARAM      lParam;
  961.     DWORD       time;
  962.     POINT       pt;
  963. } MSG, *PMSG, *NPMSG, *LPMSG;
  964. cpp_quote("#endif // _WIN32")
  965. cpp_quote("#endif // WINAPI")
  966.  
  967.  
  968. typedef [unique] userHBITMAP      * wireHBITMAP;
  969. typedef [unique] userHPALETTE     * wireHPALETTE;
  970. typedef [unique] userHENHMETAFILE * wireHENHMETAFILE;
  971. typedef [unique] userHMETAFILE    * wireHMETAFILE;
  972. typedef [unique] userHMETAFILEPICT* wireHMETAFILEPICT;
  973.  
  974. cpp_quote("#if 0")
  975.  
  976. DECLARE_WIREM_HANDLE( HGLOBAL );
  977. typedef HGLOBAL HLOCAL;
  978.  
  979. DECLARE_WIREM_HANDLE( HBITMAP );
  980. DECLARE_WIREM_HANDLE( HPALETTE );
  981. DECLARE_WIREM_HANDLE( HENHMETAFILE );
  982. DECLARE_WIREM_HANDLE( HMETAFILE );
  983. cpp_quote("#endif //0")
  984.  
  985. DECLARE_WIREM_HANDLE( HMETAFILEPICT );
  986.  
  987. }
  988.  
  989. // #########################################################################
  990. //
  991.  
  992. typedef double DATE;
  993.  
  994. /* This is a helper struct for use in handling currency. */
  995. cpp_quote("#ifndef _tagCY_DEFINED")
  996. cpp_quote("#define _tagCY_DEFINED")
  997. cpp_quote("#define _CY_DEFINED")
  998.  
  999. cpp_quote("#if 0")
  1000.  
  1001. cpp_quote("/* the following isn't the real definition of CY, but it is */")
  1002. cpp_quote("/* what RPC knows how to remote */")
  1003. typedef struct CY {
  1004.     LONGLONG    int64;
  1005. } CY;
  1006.  
  1007. cpp_quote("#else /* 0 */")
  1008.  
  1009. cpp_quote("/* real definition that makes the C++ compiler happy */")
  1010. cpp_quote("typedef union tagCY {")
  1011. cpp_quote("    struct {         ")
  1012. cpp_quote("#ifdef _MAC          ")
  1013. cpp_quote("        long      Hi;")
  1014. cpp_quote("        long Lo;     ")
  1015. cpp_quote("#else                ")
  1016. cpp_quote("        unsigned long Lo;")
  1017. cpp_quote("        long      Hi;")
  1018. cpp_quote("#endif               ")
  1019. cpp_quote("    };               ")
  1020. cpp_quote("    LONGLONG int64;  ")
  1021. cpp_quote("} CY;                ")
  1022. cpp_quote("#endif /* 0 */")
  1023.  
  1024. cpp_quote("#endif /* _tagCY_DEFINED */")
  1025. typedef CY CURRENCY;
  1026.  
  1027.  
  1028. /* IDL declarations for BSTR how to transmit them */
  1029. //
  1030. typedef FLAGGED_WORD_BLOB   userBSTR;
  1031. typedef [unique] userBSTR * wireBSTR;
  1032.  
  1033. typedef [wire_marshal( wireBSTR )] OLECHAR *  BSTR;
  1034. typedef BSTR * LPBSTR; 
  1035.  
  1036. cpp_quote("/* Don't use XBSTR any more, just use BSTR instead */")
  1037. cpp_quote("/* XBSTR is for internal use only, it is subject to change */")
  1038. typedef struct tagXBSTR {
  1039.     ULONG cbSize;
  1040.     [size_is(cbSize)]
  1041.     OLECHAR  rgBstrData[];
  1042.     } XBSTR;
  1043.  
  1044. cpp_quote("/* 0 == FALSE, -1 == TRUE */")
  1045. typedef short VARIANT_BOOL;
  1046.  
  1047. cpp_quote("#define VARIANT_TRUE ((VARIANT_BOOL)0xffff)")
  1048. cpp_quote("#define VARIANT_FALSE ((VARIANT_BOOL)0)")
  1049.  
  1050. cpp_quote("#ifndef _tagBLOB_DEFINED")
  1051. cpp_quote("#define _tagBLOB_DEFINED")
  1052. cpp_quote("#define _BLOB_DEFINED")
  1053. cpp_quote("#define _LPBLOB_DEFINED")
  1054. typedef struct tagBLOB {
  1055.     ULONG cbSize;
  1056.     [size_is(cbSize)]
  1057.     BYTE  *pBlobData;
  1058.     } BLOB, * LPBLOB;
  1059. cpp_quote("#endif")
  1060.  
  1061. typedef struct tagCLIPDATA {
  1062.     ULONG cbSize;       // count that includes sizeof(ulClipFmt)
  1063.     long ulClipFmt;     // long to keep alignment
  1064.     [size_is(cbSize-4)]
  1065.     BYTE * pClipData;   // cbSize-sizeof(ULONG) bytes of data in clipboard format
  1066.     } CLIPDATA;
  1067.  
  1068. typedef unsigned short VARTYPE;
  1069.  
  1070. // #########################################################################
  1071. //
  1072. //  VARTYPE
  1073. //
  1074. // #########################################################################
  1075.  
  1076. /*
  1077.  * VARENUM usage key,
  1078.  *
  1079.  *   [V] - may appear in a VARIANT
  1080.  *   [T] - may appear in a TYPEDESC
  1081.  *   [P] - may appear in an OLE property set
  1082.  *
  1083.  */
  1084.  
  1085. /*
  1086.  * VARENUM usage key,
  1087.  *
  1088.  *   [V] - may appear in a VARIANT
  1089.  *   [T] - may appear in a TYPEDESC
  1090.  *   [P] - may appear in an OLE property set
  1091.  *   [S] - may appear in a Safe Array
  1092.  *
  1093.  */
  1094.  
  1095. cpp_quote("/*")
  1096. cpp_quote(" * VARENUM usage key,")
  1097. cpp_quote(" *")
  1098. cpp_quote(" * * [V] - may appear in a VARIANT")
  1099. cpp_quote(" * * [T] - may appear in a TYPEDESC")
  1100. cpp_quote(" * * [P] - may appear in an OLE property set")
  1101. cpp_quote(" * * [S] - may appear in a Safe Array")
  1102. cpp_quote(" *")
  1103. cpp_quote(" *")
  1104. cpp_quote(" *  VT_EMPTY            [V]   [P]     nothing                     ")
  1105. cpp_quote(" *  VT_NULL             [V]           SQL style Null              ")
  1106. cpp_quote(" *  VT_I2               [V][T][P][S]  2 byte signed int           ")
  1107. cpp_quote(" *  VT_I4               [V][T][P][S]  4 byte signed int           ")
  1108. cpp_quote(" *  VT_R4               [V][T][P][S]  4 byte real                 ")
  1109. cpp_quote(" *  VT_R8               [V][T][P][S]  8 byte real                 ")
  1110. cpp_quote(" *  VT_CY               [V][T][P][S]  currency                    ")
  1111. cpp_quote(" *  VT_DATE             [V][T][P][S]  date                        ")
  1112. cpp_quote(" *  VT_BSTR             [V][T][P][S]  OLE Automation string       ")
  1113. cpp_quote(" *  VT_DISPATCH         [V][T]   [S]  IDispatch FAR*              ")
  1114. cpp_quote(" *  VT_ERROR            [V][T]   [S]  SCODE                       ")
  1115. cpp_quote(" *  VT_BOOL             [V][T][P][S]  True=-1, False=0            ")
  1116. cpp_quote(" *  VT_VARIANT          [V][T][P][S]  VARIANT FAR*                ")
  1117. cpp_quote(" *  VT_UNKNOWN          [V][T]   [S]  IUnknown FAR*               ")
  1118.  
  1119. cpp_quote(" *  VT_I1                  [T]        signed char                 ")
  1120. cpp_quote(" *  VT_UI1              [V][T]   [S]  unsigned char               ")
  1121. cpp_quote(" *  VT_UI2                 [T]        unsigned short              ")
  1122. cpp_quote(" *  VT_UI4                 [T]        unsigned short              ")
  1123. cpp_quote(" *  VT_I8                  [T][P]     signed 64-bit int           ")
  1124. cpp_quote(" *  VT_UI8                 [T]        unsigned 64-bit int         ")
  1125. cpp_quote(" *  VT_INT                 [T]        signed machine int          ")
  1126. cpp_quote(" *  VT_UINT                [T]        unsigned machine int        ")
  1127. cpp_quote(" *  VT_VOID                [T]        C style void                ")
  1128. cpp_quote(" *  VT_HRESULT             [T]                                    ")
  1129. cpp_quote(" *  VT_PTR                 [T]        pointer type                ")
  1130. cpp_quote(" *  VT_SAFEARRAY           [T]        (use VT_ARRAY in VARIANT)   ")
  1131. cpp_quote(" *  VT_CARRAY              [T]        C style array               ")
  1132. cpp_quote(" *  VT_USERDEFINED         [T]        user defined type           ")
  1133. cpp_quote(" *  VT_LPSTR               [T][P]     null terminated string      ")
  1134. cpp_quote(" *  VT_LPWSTR              [T][P]     wide null terminated string ")
  1135.  
  1136. cpp_quote(" *  VT_FILETIME               [P]     FILETIME                    ")
  1137. cpp_quote(" *  VT_BLOB                   [P]     Length prefixed bytes       ")
  1138. cpp_quote(" *  VT_STREAM                 [P]     Name of the stream follows  ")
  1139. cpp_quote(" *  VT_STORAGE                [P]     Name of the storage follows ")
  1140. cpp_quote(" *  VT_STREAMED_OBJECT        [P]     Stream contains an object   ")
  1141. cpp_quote(" *  VT_STORED_OBJECT          [P]     Storage contains an object  ")
  1142. cpp_quote(" *  VT_BLOB_OBJECT            [P]     Blob contains an object     ")
  1143. cpp_quote(" *  VT_CF                     [P]     Clipboard format            ")
  1144. cpp_quote(" *  VT_CLSID                  [P]     A Class ID                  ")
  1145.  
  1146. cpp_quote(" *  VT_VECTOR                 [P]     simple counted array        ")
  1147. cpp_quote(" *  VT_ARRAY            [V]           SAFEARRAY*                  ")
  1148. cpp_quote(" *  VT_BYREF            [V]                                       ")
  1149. cpp_quote(" */")
  1150.  
  1151. enum VARENUM
  1152. {
  1153.     VT_EMPTY           = 0,
  1154.     VT_NULL            = 1,
  1155.     VT_I2              = 2,
  1156.     VT_I4              = 3,
  1157.     VT_R4              = 4,
  1158.     VT_R8              = 5,
  1159.     VT_CY              = 6,
  1160.     VT_DATE            = 7,
  1161.     VT_BSTR            = 8,
  1162.     VT_DISPATCH        = 9,
  1163.     VT_ERROR           = 10,
  1164.     VT_BOOL            = 11,
  1165.     VT_VARIANT         = 12,
  1166.     VT_UNKNOWN         = 13,
  1167.  
  1168.     VT_I1              = 16,
  1169.     VT_UI1             = 17,
  1170.     VT_UI2             = 18,
  1171.     VT_UI4             = 19,
  1172.     VT_I8              = 20,
  1173.     VT_UI8             = 21,
  1174.     VT_INT             = 22,
  1175.     VT_UINT            = 23,
  1176.     VT_VOID            = 24,
  1177.     VT_HRESULT         = 25,
  1178.     VT_PTR             = 26,
  1179.     VT_SAFEARRAY       = 27,
  1180.     VT_CARRAY          = 28,
  1181.     VT_USERDEFINED     = 29,
  1182.     VT_LPSTR           = 30,
  1183.     VT_LPWSTR          = 31,
  1184.  
  1185.     VT_FILETIME        = 64,
  1186.     VT_BLOB            = 65,
  1187.     VT_STREAM          = 66,
  1188.     VT_STORAGE         = 67,
  1189.     VT_STREAMED_OBJECT = 68,
  1190.     VT_STORED_OBJECT   = 69,
  1191.     VT_BLOB_OBJECT     = 70,
  1192.     VT_CF              = 71,
  1193.     VT_CLSID           = 72,
  1194.  
  1195.     VT_VECTOR          = 0x1000,
  1196.     VT_ARRAY           = 0x2000,
  1197.     VT_BYREF           = 0x4000,
  1198.     VT_RESERVED        = 0x8000,
  1199.     
  1200.     VT_ILLEGAL         = 0xffff,
  1201.     VT_ILLEGALMASKED   = 0x0fff,
  1202.     VT_TYPEMASK        = 0x0fff
  1203. };
  1204.  
  1205. // Property stuff
  1206. typedef ULONG PROPID;
  1207.